package com.xiongxiong.yiqing.controller;

import com.xiongxiong.yiqing.api.CommonController;
import com.xiongxiong.yiqing.api.CommonResult;
import com.xiongxiong.yiqing.pojo.vo.SysUserVO;
import com.xiongxiong.yiqing.pojo.vo.count.CountYinYangPic;
import com.xiongxiong.yiqing.service.CountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 熊熊很酷
 * @since 2022-12-14
 */
@RestController
@RequestMapping("/count")
@Api(tags = "统计")
@Slf4j
public class CountController extends CommonController {

    @Autowired
    private CountService countService;

    @ApiOperation("阴阳情况饼图")
    @GetMapping("/yinYangPic")
    public CommonResult<List<CountYinYangPic>> yinYangPic() {
        log.info("阴阳情况饼图={}", 6);
        return process(() ->  countService.yinYangPic());
    }

    @ApiOperation("近n天打卡数量统计")
    @GetMapping("/recordByDayLine/{dayNub}")
    public CommonResult<List<CountYinYangPic>> recordByDayLine(@PathVariable("dayNub") Integer dayNub) {
        log.info("近n天打卡数量统计={}", dayNub);
        return process(() ->  countService.recordByDayLine(dayNub));
    }


}
